package com.xuanyuan.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
public class Employee {
    private Integer id;

    @NotBlank(message = "姓名不能为空")
    @Size(min = 0, max = 20, message = "姓名长度不能超过20个字符")
    private String name;
    @Size(min = 0, max = 1, message = "性别编码长度不能超过1个字符")
    private String sex;
    @Size(min = 0, max = 11, message = "手机长度不能超过11个字符")
    private String phone;
    @Size(min = 0, max = 30, message = "电话长度不能超过30个字符")
    private String telephone;
    @Email(message = "邮箱格式错误")
    private String email;
    @Size(min = 0, max = 50, message = "学历长度不能超过50个字符")
    private String education;
    @Size(min = 0, max = 18, message = "身份证长度不能超过18个字符")
    private String idNo;
    @Size(min = 0, max = 50, message = "政治面貌长度不能超过50个字符")
    private String politicalOutlook;
    @Size(min = 0, max = 50, message = "QQ长度不能超过50个字符")
    private String qqNo;
    @Size(min = 0, max = 500, message = "地址长度不能超过500个字符")
    private String address;
    @Size(min = 0, max = 6, message = "邮政编码长度不能超过6个字符")
    private String postCode;
    @Size(min = 0, max = 50, message = "民族长度不能超过50个字符")
    private String nation;
    @Size(min = 0, max = 50, message = "专业长度不能超过50个字符")
    private String major;
    @Size(min = 0, max = 50, message = "爱好长度不能超过50个字符")
    private String hobby;
    private String status;
    @Size(min = 0, max = 500, message = "备注长度不能超过500个字符")
    private String remark;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    private Integer deptId;
    private Dept dept;
    private Integer postId;
    private Post post;
}
